<?php
$article = $this->article;
$marks = range(1, 5);
$isLogged = \Zend_Auth::getInstance()->hasIdentity();
?>


<?php echo $this->partial('/index/_article.phtml', array('article' => $article)); ?>

<?php if ($article['allowComments']): ?>
<!--Comments:-->
<div id="comments">
    <?php echo $this->partial('/index/_comments.phtml', array('comments' => $article['comments'], 'article' => $article['id'])) ?>
    <span style="padding-bottom: 20px;">
        <? if ($isLogged): ?>
        <a href="#" id="<?php echo $this->commentId($article['id']) ?>" class="comment-form">Добавить комментарий</a>
        <? endif ?>
    </span>
</div>
<?php endif; ?>

<? if ($isLogged): ?>
<div id="comment-form" style="display: none;">
    <?php echo $this->form ?>
</div>
<? endif; ?>

<?php if (count($article['similar'])): ?>
<h2>Похожие новости:</h2>
<?php foreach ($article['similar'] as $similar): ?>
    <?php echo $this->partial('/index/_article_small.phtml', array('article' => $similar)); ?>
    <?php endforeach; ?>
<?php endif; ?>

<script type="text/javascript">
    $().ready(function () {
        initCommentsMark();
    });
</script>